package com.survey.service.impl;

import com.survey.dao.mapper.QuestionBodyMapper;
import com.survey.pojo.data.QuestionBodyDO;
import com.survey.service.QuestionBodyService;
import com.survey.utils.Result;
import com.survey.pojo.vo.QuestionBodyVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/** 
 * <br/>
 * Created by jj on 2018/08/04
 */
@Service("questionBodyService")
public class QuestionBodyServiceImpl implements QuestionBodyService {

	private final static Logger LOG = LoggerFactory.getLogger(QuestionBodyServiceImpl.class);

	@Resource
	private QuestionBodyMapper questionBodyMapper;

	@Override
	public Integer addQuestionBody(QuestionBodyVO questionBodyVO) throws Exception {
		return questionBodyMapper.addQuestionBody(questionBodyVO);
	}

	@Override
	public Result updateQuestionBody(QuestionBodyVO questionBodyVO) throws Exception {
		Integer row = questionBodyMapper.updateQuestionBody(questionBodyVO);
		if(row>0){
			return new Result(Result.CODE_SUCCESS);
		}
		return new Result(Result.CODE_FAILURE);
	}
	
	@Override
	public QuestionBodyDO findDetailQuestionBody(QuestionBodyVO questionBodyVO) throws Exception{
		return questionBodyMapper.findDetailQuestionBody(questionBodyVO);
	}

	@Override
	public Result listQuestionBody(QuestionBodyVO questionBodyVO) throws Exception{
		return null;
	}
	
	@Override
	public Result listQuestionBodyPage(QuestionBodyVO questionBodyVO) throws Exception{
		return null;
	}
	
	@Override
	public Result countQuestionBody(QuestionBodyVO questionBodyVO) throws Exception{
		return null;
	}
	
	@Override
	public Result deleteQuestionBody(QuestionBodyVO questionBodyVO) throws Exception{
		return null;
	}

}